//author: dschuetz
package com.me.mygdxgame.Components;

import com.badlogic.gdx.math.Rectangle;
import com.me.mygdxgame.Component;

public class BoundingBox extends Component {
	private boolean isTouched; 
	private Rectangle rectangle;
	
	public BoundingBox(Rectangle rect)
	{
		this.rectangle = rect;
		this.isTouched = false;
	}
	
	public boolean touched() {
		return isTouched;
	}
	
	public void  touchFunction(int inputX, int inputY) {
		
		if(this.rectangle.contains(inputX, inputY)) {
			isTouched = true;
		}
		else {
			isTouched = false;
		}
	}
}


